public class 国王发金币 {

    public static void main(String[] args) {
        int n = 6;
        int total = fun(n);
        System.out.println(total);

        // 1 2 2 3 3 3 4 4 4
        // 1 2 3 4 5 6 7 8 9
    }
    public static int fun(int n){
        int sum = 0;
        for (int i = 1; i <= 6; i++) {
            for (int j = 1; j <=i; j++) {
                sum = sum + i;
            }
        }
        return sum;
    }
}
